package com.bootdo.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bootdo.system.domain.TbDdbl;
import com.bootdo.system.domain.TbDdblExample;
import com.bootdo.system.domain.TbDdblExample.Criteria;
import com.bootdo.system.mapper.TbDdblMapper;
import com.bootdo.system.service.DdbjService;

@Service
public class DdbjServiceImpl implements DdbjService{
	
	@Autowired
	private TbDdblMapper dm;

	@Override
	public TbDdbl getByOid(String oid) {
		TbDdblExample tbDdblExample = new TbDdblExample();
		Criteria createCriteria = tbDdblExample.createCriteria();
		createCriteria.andOrderIdEqualTo(oid);
		List<TbDdbl> selectByExample = dm.selectByExample(tbDdblExample);
		if(selectByExample != null && selectByExample.size() > 0) {
			return selectByExample.get(0);
		}
		return null;
	}

	@Override
	public int insert(TbDdbl table) {
		return dm.insert(table);
	}

}
